home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 March / SGI IRIX Patches 1995 Mar.iso / 5.3_patches / patchSG0000221 / patchSG0000221.idb / usr / include / ftw.h.z / ftw.h
Encoding:
C/C++ Source or Header  |  1995-03-10  |  3.1 KB  |  103 lines

  1. /*
  2. *
  3. * Copyright 1992, Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. *
  6. * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  7. * the contents of this file may not be disclosed to third parties, copied or
  8. * duplicated in any form, in whole or in part, without the prior written
  9. * permission of Silicon Graphics, Inc.
  10. *
  11. * RESTRICTED RIGHTS LEGEND:
  12. * Use, duplication or disclosure by the Government is subject to restrictions
  13. * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  14. * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  15. * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  16. * rights reserved under the Copyright Laws of the United States.
  17. */
  18. /*    Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.    */
  19. /*    Copyright (c) 1988 AT&T    */
  20. /*      All Rights Reserved      */
  21.  
  22. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  23. /*    UNIX System Laboratories, Inc.                         */
  24. /*    The copyright notice above does not evidence any       */
  25. /*    actual or intended publication of such source code.    */
  26. #ifndef __FTW_H__
  27. #define __FTW_H__
  28. #ident "$Revision: 1.14 $"
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34.  
  35. /*
  36.  *    Codes for the third argument to the user-supplied function
  37.  *    which is passed as the second argument to ftwalk
  38.  */
  39.  
  40. #define    FTW_F    0    /* file */
  41. #define    FTW_D    1    /* directory */
  42. #define    FTW_DNR    2    /* directory without read permission */
  43. #define    FTW_NS    3    /* unknown type, stat failed */
  44. #define FTW_SL    4    /* symbolic link */
  45. #define    FTW_DP    6    /* directory */
  46. #define FTW_SLN    7    /* symbolic link that points to nonexistent file */
  47.  
  48. /*
  49.  *    Codes for the fourth argument to ftwalk.  You can specify the
  50.  *    union of these flags.
  51.  */
  52.  
  53. #define FTW_PHYS    01  /* use lstat instead of stat */
  54. #define FTW_MOUNT    02  /* do not cross a mount point */
  55. #define FTW_CHDIR    04  /* chdir to each directory before reading */
  56. #define FTW_DEPTH    010 /* call descendents before calling the parent */
  57.  
  58. struct FTW
  59. {
  60.     int    quit;
  61.     int    base;
  62.     int    level;
  63. };
  64.  
  65. /*
  66.  * legal values for quit
  67.  */
  68.  
  69. #define FTW_SKD        1
  70. #define FTW_FOLLOW    2
  71. #define FTW_PRUNE    4
  72.  
  73. #if defined(_MODERN_C)
  74.  
  75. #include <sys/types.h>
  76. #include <sys/stat.h>
  77. extern int ftw(const char *, int (*)(const char *, const struct stat *, int), int);
  78. extern int _xftw(int, const char *, int (*)(const char *, const struct stat *, int), int);
  79. extern int nftw(const char *, int (*)(const char *, const struct stat *, int, struct FTW *), int, int);
  80.  
  81. #if (defined(_SGI_SOURCE) && !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) && !defined(_ABI_SOURCE))
  82. extern int ftw64(const char *, int (*)(const char *, const struct stat64 *, int), int);
  83. extern int _xftw64(int, const char *, int (*)(const char *, const struct stat64 *, int), int);
  84. extern int nftw64(const char *, int (*)(const char *, const struct stat64 *, int, struct FTW *), int, int);
  85. #endif
  86.  
  87. #else
  88.  
  89. extern int ftw(), nftw();
  90.  
  91. #if (defined(_SGI_SOURCE) && !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) && !defined(_ABI_SOURCE))
  92. extern int ftw64(), nftw64();
  93. #endif
  94.  
  95. #endif
  96.  
  97. #define XFTWVER    2    /* version of file tree walk */
  98.  
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif /* !__FTW_H__ */
  103.